package com.newer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newer.domain.ApplyDetails;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ApplyDetailsMapper extends BaseMapper<ApplyDetails> {

    @Select("select ad.*,m.materialName,m.imgName,m.unit from t_appLy_Details ad inner join t_material m  on ad.materialId=m.materialId where applyId=#{applyid}")
    @Results({
            @Result(column = "appLyDetailsId",property = "applydetailsid"),
            @Result(column = "applyId",property = "applyid"),
            @Result(column = "count",property = "count"),
            @Result(column = "price",property = "price"),
            @Result(column = "materialName",property = "material.materialname"),
            @Result(column = "imgName",property = "material.imgname"),
            @Result(column = "unit",property = "material.unit"),
    })
    List<ApplyDetails> selectApplyDetails(String applyid);
}